
window.onload = function(){
	alert(document.getElementById("box").innerHTML);
	alert(document.getElementsByName('sex')[0].value);
	alert(document.getElementsByTagName('p')[0].innerHTML);
	
	///
	alert($('box').innerHTML);
	//
	alert(Base.getName('sex')[0].value);
	alert(Base.getTag('p')[0].innerHTML);
}

/*
 函数式封装
 * */
function $(id){
return document.getElementById(id);
}

/**
 * 对象是封装
 * */

 var Base = {
 	getId:function(id){
 		return document.getElementById(id);
 	},
 	getName :function(name){
 		return document.getElementsByName(name);
 	},
 	getTag :function(tag){
 		return document.getElementsByTagName(tag);
 	}
 };
